home *** CD-ROM | disk | FTP | other *** search
-
- ;////////////////////////////////////////////////////////////
- ;Program 3.1.
- ;////////////////////////////////////////////////////////////
-
- ; PIC_REPR.
- ; This program changes the standard initialization
- ; set for both PICs (I8259). IRQ0-7 will be serviced through
- ; vectors 50-57h.
- ;
- .DOSSEG
- .MODEL small
- .DATA
- .STACK 100h
- .CODE
- .STARTUP
- cli ;Interrupts are forbidden
-
- call Move8to50 ;Send vectors to the new area
-
- mov bx,5070h;BH:IRQ0-7, BL:IRQ8-15
-
- call Setdef ;Re-initialize PICs
-
- sti
- .EXIT 0
-
- Move8to50 PROC near
- mov cx,32
- xor ax,ax
- mov es,ax
- mov ds,ax
- mov si,8*4 ;SI points to the first
- ;byte of vectors 08-0Fh in the
- ;Interrupt Vector Table.
- mov di,50h*4 ;DI points to the first
- ;byte of vectors 50h-57h in
- ;Interrupt Vector Table.
-
- Lab1: mov bl, BYTE ptr es:[si]
- mov BYTE ptr ds:[di],bl
- mov BYTE ptr es:[si],0
- inc di
- inc si
- loop Lab1
-
- ret
- Move8to50 ENDP
-
- Setdef PROC near
- mov al,11h ;---+
- out 0A0h,al ; | Set ICW1 00010001b
- jmp short $+2 ; |
- jmp short $+2 ; |
- out 20h,al ;---+
- jmp short $+2
- jmp short $+2
- mov al,bl ;---+
- out 0A1h,al ; |01110xxx (BIOS 70-77h)
- jmp short $+2 ; | Set ICW2
- jmp short $+2 ; |
- mov al,bh ; |
- out 21h,al ;---+00001xxx (BIOS 8-0Fh)
- jmp short $+2
- jmp short $+2
- mov al,2 ;---+
- out 0A1h,al ; |
- jmp short $+2 ; | Set ICW3
- jmp short $+2 ; |
- mov al,4 ; |
- out 21h,al ;---+
- jmp short $+2
- jmp short $+2
- mov al,1 ;---+
- out 0A1h,al ; |
- jmp short $+2 ; | Set ICW4
- jmp short $+2 ; |
- out 21h,al ;---+
- jmp short $+2
- jmp short $+2
- mov al,0 ;---+
- out 0A1h,al ; | Set OCW1 (IMR(Mask))
- jmp short $+2 ; |
- jmp short $+2 ; |
- out 21h,al ;---+
- ret
- Setdef ENDP
- END
-
-